package com.hn.kiss.modules.sys.service.impl;

import com.hn.kiss.modules.sys.entity.Tt;
import com.hn.kiss.modules.sys.mapper.TtMapper;
import com.hn.kiss.modules.sys.service.ITtService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 测试 服务实现类
 * </p>
 *
 * @author zxy
 * @since 2020-08-24
 */
@Service
public class TtServiceImpl extends ServiceImpl<TtMapper, Tt> implements ITtService {

    @Override
    public Tt getByPk(String id) {
        LambdaQueryWrapper<Tt> lambda = new QueryWrapper<Tt>().lambda()
                .eq(Tt::getId, id);
        return baseMapper.selectOne(lambda);
    }

    @Override
    public boolean updateByPk(Tt tt) {
        LambdaQueryWrapper<Tt> lambda = new QueryWrapper<Tt>().lambda()
                .eq(Tt::getId, tt.getId());
        return super.update(tt, lambda);
    }

    @Override
    public boolean removeByPk(String id) {
        LambdaQueryWrapper<Tt> lambda = new QueryWrapper<Tt>().lambda()
                .eq(Tt::getId, id);
        return super.remove(lambda);
    }

}
